/*     */ package network;
/*     */ 
/*     */ import java.util.Enumeration;
/*     */ import player.Move;
/*     */ 
/*     */ public final class X2
/*     */ {
/*     */   public static final int BLACK = 0;
/*     */   public static final int WHITE = 1;
/*     */   public static final int xxxo = 2;
/*     */   public static final int ooxo = 3;
/*     */   private int[][] array;
/*     */   public static final int oxox = 8;
/*     */   public static final int ooox = 2;
/*     */   public static final int xoox = 10;
/*  21 */   private int x3271 = 0;
/*  22 */   private int x4108 = 0;
/*     */   private boolean[][] tag;
/*     */ 
/*     */   public X2()
/*     */   {
/*  27 */     this.array = new int[8][8];
/*  28 */     this.tag = new boolean[8][8];
/*  29 */     xoxox();
/*     */   }
/*     */ 
/*     */   public void xoxox() {
/*  33 */     for (int i = 0; i < 8; i++) {
/*  34 */       for (int j = 0; j < 8; j++)
/*  35 */         this.array[i][j] = 2;
/*     */     }
/*  37 */     this.array[0][0] = 3;
/*  38 */     this.array[7][0] = 3;
/*  39 */     this.array[0][7] = 3;
/*  40 */     this.array[7][7] = 3;
/*     */ 
/*  42 */     this.x3271 = (this.x4108 = 0);
/*     */   }
/*     */ 
/*     */   public Move oooxo(int paramInt) {
/*  46 */     Move localMove = new Move();
/*  47 */     if (xoooo(paramInt)) { localMove.moveKind = 2;
/*     */       int i;
/*     */       int j;
/*     */       while (true) { i = (int)Math.floor(Math.random() * 8.0D);
/*  52 */         j = (int)Math.floor(Math.random() * 8.0D);
/*  53 */         if (this.array[i][j] == paramInt) break;
/*     */       }
/*  55 */       localMove.x2 = i;
/*  56 */       localMove.y2 = j;
/*     */     } else {
/*  58 */       localMove.moveKind = 1;
/*     */     }
/*     */     while (true) {
/*  61 */       localMove.x1 = (int)Math.floor(Math.random() * 8.0D);
/*  62 */       localMove.y1 = (int)Math.floor(Math.random() * 8.0D);
/*  63 */       if (xooox(localMove, paramInt)) break;
/*     */     }
/*  65 */     return localMove;
/*     */   }
/*     */ 
/*     */   public boolean oxxxo(int paramInt1, int paramInt2) {
/*  69 */     return (paramInt1 >= 0) && (paramInt1 < 8) && (paramInt2 >= 0) && (paramInt2 < 8);
/*     */   }
/*     */ 
/*     */   private boolean xxxxo(int paramInt1, int paramInt2, int paramInt3) {
/*  73 */     for (int i = 0; i < 8; i++)
/*  74 */       for (int j = 0; j < 8; j++)
/*  75 */         this.tag[i][j] = false;
/*  76 */     return xxoxo(paramInt1, paramInt2, paramInt3) >= 2;
/*     */   }
/*     */ 
/*     */   private int xxoxo(int paramInt1, int paramInt2, int paramInt3) {
/*  80 */     int i = 0;
/*  81 */     for (int j = paramInt1 - 1; j < paramInt1 + 2; j++)
/*  82 */       for (int k = paramInt2 - 1; k < paramInt2 + 2; k++)
/*  83 */         if ((oxxxo(j, k)) && (this.array[j][k] == paramInt3) && (this.tag[j][k] == false)) {
/*  84 */           this.tag[j][k] = true;
/*  85 */           i += 1 + xxoxo(j, k, paramInt3);
/*     */         }
/*  87 */     return i;
/*     */   }
/*     */ 
/*     */   public boolean oxoxx(int paramInt1, int paramInt2, int paramInt3)
/*     */   {
/*  93 */     switch (paramInt3) {
/*     */     case 1:
/*  95 */       return paramInt1 % 7 == 0;
/*     */     }
/*  97 */     return paramInt2 % 7 == 0;
/*     */   }
/*     */ 
/*     */   public static int ooxxx(int paramInt)
/*     */   {
/* 102 */     return paramInt == 0 ? 1 : 0;
/*     */   }
/*     */ 
/*     */   public boolean xxoox(int paramInt) {
/* 106 */     return (paramInt == 0 ? this.x3271 : this.x4108) < 10;
/*     */   }
/*     */ 
/*     */   public boolean xoooo(int paramInt) {
/* 110 */     return !xxoox(paramInt);
/*     */   }
/*     */ 
/*     */   public boolean xooox(Move paramMove, int paramInt)
/*     */   {
/* 115 */     if (paramMove.moveKind == 0) return true;
/* 116 */     if ((paramMove.moveKind == 1) && (!xxoox(paramInt))) return false;
/* 117 */     if ((paramMove.moveKind == 2) && (!xoooo(paramInt))) return false;
/*     */ 
/* 119 */     int i = 1;
/* 120 */     int j = paramMove.x1;
/* 121 */     int k = paramMove.y1;
/*     */ 
/* 123 */     if (!oxxxo(j, k)) return false;
/* 124 */     if (this.array[j][k] != 2) return false;
/* 125 */     if (oxoxx(j, k, ooxxx(paramInt))) return false;
/* 126 */     if (paramMove.moveKind == 2) {
/* 127 */       if (this.array[paramMove.x2][paramMove.y2] != paramInt) return false;
/* 128 */       this.array[paramMove.x2][paramMove.y2] = 2;
/*     */     }
/* 130 */     if (xxxxo(j, k, paramInt)) i = 0;
/*     */ 
/* 132 */     if ((oxoxo(0) != null) && (oxoxo(1) != null))
/*     */     {
/* 134 */       i = 0;
/*     */     }
/* 136 */     if (paramMove.moveKind == 2)
/* 137 */       this.array[paramMove.x2][paramMove.y2] = paramInt;
					if( i==0){
						return false;
					}
					else return true;
/* 138 */     //return i;
/*     */   }
/*     */ 
/*     */   public X5 oxoxo(int paramInt) {
/* 142 */     for (Enumeration localEnumeration = X5.oxxxo(this, paramInt); localEnumeration.hasMoreElements(); ) {
/* 143 */       X5 localX5 = (X5)localEnumeration.nextElement();
/* 144 */       if (localX5.oxoxo()) return localX5;
/*     */     }
/* 146 */     return null;
/*     */   }
/*     */ 
/*     */   public boolean xxxox(Move paramMove, int paramInt) {
/* 150 */     if (!xooox(paramMove, paramInt)) return false;
/* 151 */     this.array[paramMove.x1][paramMove.y1] = paramInt;
/* 152 */     if (paramMove.moveKind == 2)
/* 153 */       this.array[paramMove.x2][paramMove.y2] = 2;
/* 154 */     else if (paramMove.moveKind == 1) {
/* 155 */       if (paramInt == 0) this.x3271 += 1; else this.x4108 += 1;
/*     */     }
/* 157 */     return true;
/*     */   }
/*     */ 
/*     */   public int oooxx(int paramInt1, int paramInt2) {
	//System.out.println("1:"+paramInt1+", 2:"+paramInt2);
/* 161 */     return this.array[paramInt1][paramInt2];
/*     */   }
/*     */ }

/* Location:           C:\Users\Justin\Desktop\pj2\
 * Qualified Name:     network.X2
 * JD-Core Version:    0.6.0
 */